﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace SscLib
{
    public class CtorSymbol : MethodSymbolBase
    {

        public ConstructorInfo Info;

        internal CtorSymbol()
            : base(".ctor", null)
        {
        }

        public void ImportBaseArguments(CtorSymbol baseCtor)
        {
            foreach (ArgumentSymbol arg in baseCtor.Args)
            {
                if (arg.Name != "_outer")
                {
                    ArgumentSymbol newArg = this.AddArgument(arg.Name, arg.Type);
                    if (newArg.Adr != arg.Adr) throw new Exception("Error importing base ctor args. Arg address do not match. " + arg.Name);
                }
            }
        }
    }
}
